﻿#pragma once
#include <stdint.h>

constexpr uint8_t NOP_OPCODE = 0x90;
constexpr uint8_t RET_OPCODE = 0xC3;
constexpr uint8_t JMP_OPCODE = 0xE9;
constexpr uint8_t JNE_OPCODE = 0x85;

#define GAME_VERSION 200 // Use this BEFORE compilation to decide which version of TLAC you want to build. You should find ALL of the constants (with the exception of pause.)
// added 04/19/2020 가자onetwo 

#if GAME_VERSION == 710
// This is the debug stuff. Useful.
constexpr uint64_t PREVENT_DATA_TEST_EXIT = 0x0000000140284B01;
constexpr uint64_t ENABLE_DW_GUI = 0x0000000140192601;
constexpr uint64_t UPDATE_DW_GUI = 0x0000000140302600;
constexpr uint64_t DRAW_DW_GUI = 0x0000000140302610;
constexpr uint64_t ENABLE_DW_GUI_WIDGETS = 0x0000000140192D00;

constexpr uint64_t ENGINE_UPDATE_ADDRESS = 0x000000014018CC40;
constexpr uint64_t ENGINE_UPDATE_INPUT_ADDRESS = 0x000000014018CBB0;
constexpr uint64_t ENGINE_DRAW_2D_ADDRESS = 0x0000000140501F70;
constexpr uint64_t ENGINE_FINISH_DRAW_ADDRESS = 0x0000000140192730;

constexpr uint64_t CURRENT_GAME_STATE_ADDRESS = 0x0000000140EDA810;
constexpr uint64_t CURRENT_GAME_SUB_STATE_ADDRESS = 0x0000000140EDA82C;
constexpr uint64_t RESOLUTION_WIDTH_ADDRESS = 0x0000000140EDA8BC;
constexpr uint64_t RESOLUTION_HEIGHT_ADDRESS = 0x0000000140EDA8C0;

constexpr uint64_t SYSTEM_WARNING_ELAPSED_ADDRESS = (0x00000001411A1430 + 0x68);
constexpr uint64_t DATA_INIT_STATE_ADDRESS = 0x0000000140EDA7A8;

constexpr uint64_t AET_FRAME_DURATION_ADDRESS = 0x00000001409A0A58;
constexpr uint64_t PV_FRAME_RATE_ADDRESS = 0x0000000140EDA7CC;
constexpr uint64_t FRAME_SPEED_ADDRESS = 0x0000000140EDA798;
constexpr uint64_t FRAME_RATE_ADDRESS = 0x0000000140EDA6D0;
constexpr uint64_t USE_AUTO_FRAMESPEED_ADDRESS = 0x0000000140EDA79C;
constexpr uint64_t AUTO_FRAMESPEED_TARGET_FRAMERATE_ADDRESS = 0x0000000140EDA6CC;

constexpr uint64_t DW_GUI_DISPLAY_INSTANCE_PTR_ADDRESS = 0x0000000141190108;
constexpr uint64_t INPUT_STATE_PTR_ADDRESS = 0x0000000140EDA330;
constexpr uint64_t SLIDER_CTRL_TASK_ADDRESS = 0x000000014CC5DE40;
constexpr uint64_t TASK_TOUCH_ADDRESS = 0x000000014CC9EC30;
constexpr uint64_t SEL_PV_TIME_ADDRESS = 0x000000014CC12498;
constexpr uint64_t PLAYER_DATA_ADDRESS = 0x00000001411A8850;
constexpr uint64_t SET_DEFAULT_PLAYER_DATA_ADDRESS = 0x00000001404A7370;
constexpr uint64_t PLAYS_PER_SESSION_GETTER_ADDRESS = 0x000000014038AEE0;
constexpr uint64_t PV_SEL_SLOTS_TO_SCROLL = 0x000000014CC12470;
constexpr uint64_t PV_SEL_SLOTS_CONST = 0x000000014CC119C8;
constexpr uint64_t MODULE_SEL_SLOTS_TO_SCROLL = 0x00000001418047EC;
constexpr uint64_t MODULE_IS_RECOMMENDED = 0x00000001418047E0;

constexpr uint64_t CAMERA_ADDRESS = 0x0000000140FBC2C0;
constexpr uint64_t CAMERA_POS_SETTER_ADDRESS = 0x00000001401F9460;
constexpr uint64_t CAMERA_INTR_SETTER_ADDRESS = 0x00000001401F93F0;
constexpr uint64_t CAMERA_ROT_SETTER_ADDRESS = 0x00000001401F9480;
constexpr uint64_t CAMERA_PERS_SETTER_ADDRESS = 0x00000001401F9430;

constexpr uint64_t UPDATE_TASKS_ADDRESS = 0x000000014019B980;
constexpr uint64_t GLUT_SET_CURSOR_ADDRESS = 0x00000001408B68E6;
constexpr uint64_t CHANGE_MODE_ADDRESS = 0x00000001401953D0;
constexpr uint64_t CHANGE_SUB_MODE_ADDRESS = 0x0000000140195260;

constexpr uint64_t TGT_CLASS_ADDRESS = 0x0000000140D0B660;
constexpr uint64_t TGT_STATES_FIRST_POINTER_ADDRESS = 0x0000000140D0B680;
constexpr uint64_t TGT_STATES_BASE_ADDRESS = 0x0000000140D0B688;
constexpr uint64_t TGT_ON_SCREEN_ADDRESS = 0x0000000140D0B678;

constexpr uint64_t HOLD_STATE_ADDRESS = 0x0000000140D1E20C;
constexpr uint64_t MAX_HOLD_STATE_ADDRESS = 0x0000000140D1E234;

constexpr uint64_t CHECK_SOMETHING_SET_MODULE_ADDRESS = 0x0000000140581C78;
constexpr uint64_t MODSELECTOR_CHECK_FUNCTION_ERRRET_ADDRESS = 0x00000001405869AD;
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_MODULE = 0x0000000140583B45;
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_CUSTOMIZE = 0x0000000140583C8C;
constexpr uint64_t MODULE_TABLE_START = PLAYER_DATA_ADDRESS + 0x140;
constexpr uint64_t MODULE_TABLE_END = MODULE_TABLE_START + 128;
constexpr uint64_t ITEM_TABLE_START = PLAYER_DATA_ADDRESS + 0x2B8;
constexpr uint64_t ITEM_TABLE_END = ITEM_TABLE_START + 128;

constexpr uint64_t FB_WIDTH_ADDRESS = 0x00000001411ABCA8;
constexpr uint64_t FB_HEIGHT_ADDRESS = 0x00000001411ABCAC;
constexpr uint64_t FB1_WIDTH_ADDRESS = 0x00000001411AD5F8;
constexpr uint64_t FB1_HEIGHT_ADDRESS = 0x00000001411AD5FC;
constexpr uint64_t FB2_WIDTH_ADDRESS = 0x0000000140EDA8E4;
constexpr uint64_t FB2_HEIGHT_ADDRESS = 0x0000000140EDA8E8;

constexpr uint64_t FB_RESOLUTION_WIDTH_ADDRESS = 0x00000001411ABB50;
constexpr uint64_t FB_RESOLUTION_HEIGHT_ADDRESS = 0x00000001411ABB54;

constexpr uint64_t UI_WIDTH_ADDRESS = 0x000000014CC621E4;
constexpr uint64_t UI_HEIGHT_ADDRESS = 0x000000014CC621E8;

constexpr uint64_t FB_ASPECT_RATIO = 0x0000000140FBC2E8;
constexpr uint64_t UI_ASPECT_RATIO = 0x000000014CC621D0;

constexpr uint64_t GET_SLIDER_TAPPED_ADDRESS = 0x0000000140618C60;
constexpr uint64_t GET_SLIDER_RELEASED_ADDRESS = 0x0000000140618C40;
constexpr uint64_t GET_SLIDER_DOWN_ADDRESS = 0x0000000140618C20;

constexpr uint64_t SHOULD_EXIT_BOOL_ADDRESS = 0x0000000140EDA6B0;
constexpr uint64_t DOEXIT_ADDRESS = 0x000000014085B574;

constexpr uint64_t RESULTS_INIT_ADDRESS = 0x000000014065BBC0;
constexpr uint64_t RESULTS_BASE_ADDRESS = 0x000000014CC93830;
constexpr uint64_t GAME_INFO_ADDRESS = 0x0000000141197E00;

constexpr uint64_t CURRENT_SONG_NAME_ADDRESS = 0x0000000140D0A578;
constexpr uint64_t CURRENT_SONG_ID_ADDRESS = 0x0000000140CDD8E0;
constexpr uint64_t SELPV_CURRENT_SONG_ADDRESS = 0x000000014CC12438;
constexpr uint64_t SONG_CLEAR_COUNTS_ADDRESS = 0x00000001411A95E8;

constexpr uint64_t AUDIO_MAIN_CLASS_ADDRESS = 0x000000014CC61120;

constexpr uint64_t DSC_TIME_ADDRESS = 0x0000000140D0B518;
constexpr uint64_t DSC_START_FROM_TIME_ADDRESS = 0x0000000140D0B540;
constexpr uint64_t DSC_START_SYS_TIME_ADDRESS = 0x0000000140D0B548;
constexpr uint64_t DSC_TIME_ADDRESS_2 = 0x0000000140D0B520;
constexpr uint64_t DSC_START_FROM_TIME_ADDRESS_2 = 0x0000000140D0B560;
constexpr uint64_t DSC_START_SYS_TIME_ADDRESS_2 = 0x0000000140D0B568;

constexpr uint64_t DSC_PAUSE_FUNC_ADDRESS = 0x00000001401295C0;
constexpr uint64_t DSC_UNPAUSE_FUNC_ADDRESS = 0x0000000140129590;

constexpr uint64_t DSC_POSITION_ADDRESS = 0x0000000140D098A4;
constexpr uint64_t DSC_TIME_RESET_ADDRESS = 0x0000000140D0B538;
constexpr uint64_t DSC_TIME_RESET_ADDRESS_2 = 0x0000000140D0B512;
constexpr uint64_t DSC_TIME_RESET_FLAG_1 = 0x0000000140CDD7D0;
constexpr uint64_t DSC_TIME_RESET_FLAG_2 = 0x0000000140CDD7D4;

constexpr uint64_t PV_GAME_BASE_ADDRESS = 0x000000014CC95270;
constexpr uint64_t GIVEUP_FUNC_ADDRESS = 0x000000014010EF00;

constexpr uint64_t PV_STATE_ADDRESS = 0x0000000140D0B512;
constexpr uint64_t PV_LOADING_STATE_ADDRESS = 0x0000000140D0B524;
constexpr uint64_t PV_INNER_LOADING_STATE_ADDRESS = 0x0000000140CDD8D8;

constexpr uint64_t AET_DEBUG_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0x98;
constexpr uint64_t AET_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0xD8;
#endif

#if GAME_VERSION == 400
//constexpr uint64_t ENGINE_UPDATE_HOOK_TARGET_ADDRESS	= 0x000000014018CC40;

//1400669f0 (enable dw_gui in 4.00)
// These are placeholders so that it compiles. from 7.10
constexpr uint64_t PREVENT_DATA_TEST_EXIT = 0x0000000140284B01;
constexpr uint64_t ENABLE_DW_GUI = 0x0000000140192601;
constexpr uint64_t UPDATE_DW_GUI = 0x0000000140302600;
constexpr uint64_t DRAW_DW_GUI = 0x0000000140302610;
constexpr uint64_t ENABLE_DW_GUI_WIDGETS = 0x0000000140192D00;

constexpr uint64_t ENGINE_UPDATE_ADDRESS = 0x0000000140060ee0;
constexpr uint64_t ENGINE_UPDATE_INPUT_ADDRESS = 0x00000001405c5b00;
constexpr uint64_t ENGINE_DRAW_2D_ADDRESS = 0x000000014039CA10;
constexpr uint64_t ENGINE_FINISH_DRAW_ADDRESS = 0x0000000140066B20;

constexpr uint64_t CURRENT_GAME_STATE_ADDRESS = 0x0000000140d8d280;
constexpr uint64_t CURRENT_GAME_SUB_STATE_ADDRESS = 0x0000000140d8d29c;
constexpr uint64_t RESOLUTION_WIDTH_ADDRESS = 0x0000000140d8d32c;
constexpr uint64_t RESOLUTION_HEIGHT_ADDRESS = 0x0000000140d8d330;

constexpr uint64_t SYSTEM_WARNING_ELAPSED_ADDRESS = (0x0000000140f05b30 + 0x68);
constexpr uint64_t DATA_INIT_STATE_ADDRESS = 0x0000000140d8d238;

constexpr uint64_t AET_FRAME_DURATION_ADDRESS = 0x00000001408b7308;
constexpr uint64_t PV_FRAME_RATE_ADDRESS = 0x0000000140d8d25c;
constexpr uint64_t FRAME_SPEED_ADDRESS = 0x0000000140d8d228;
constexpr uint64_t FRAME_RATE_ADDRESS = 0x0000000140d8d160;
constexpr uint64_t USE_AUTO_FRAMESPEED_ADDRESS = 0x0000000140d8d22c;
constexpr uint64_t AUTO_FRAMESPEED_TARGET_FRAMERATE_ADDRESS = 0x0000000140d8d15c;

constexpr uint64_t DW_GUI_DISPLAY_INSTANCE_PTR_ADDRESS = 0x0000000140ef1710;
constexpr uint64_t INPUT_STATE_PTR_ADDRESS = 0x0000000140d8cdc8;
constexpr uint64_t SLIDER_CTRL_TASK_ADDRESS = 0x0000000140f8b660;
constexpr uint64_t TASK_TOUCH_ADDRESS = 0x0000000140fcbc00;
constexpr uint64_t SEL_PV_TIME_ADDRESS = 0x000000014CC12498;
constexpr uint64_t PLAYER_DATA_ADDRESS = 0x0000000140f0c770;
constexpr uint64_t SET_DEFAULT_PLAYER_DATA_ADDRESS = 0x0000000140355560;
constexpr uint64_t PLAYS_PER_SESSION_GETTER_ADDRESS = 0x0000000140251970;
constexpr uint64_t PV_SEL_SLOTS_TO_SCROLL = 0x0000000140F3FEF0; // found this, the base data point is DAT_14cc11960 in 7 and DAT_140f3f3e0 for 4.00. add B10
constexpr uint64_t PV_SEL_SLOTS_CONST = 0x0000000140F3F448;
constexpr uint64_t MODULE_SEL_SLOTS_TO_SCROLL = 0x0000000140F3E49C;
constexpr uint64_t MODULE_IS_RECOMMENDED = 0x0000000140F3E490;

constexpr uint64_t CAMERA_ADDRESS = 0x0000000140e3a540;
constexpr uint64_t CAMERA_POS_SETTER_ADDRESS = 0x00000001400D5370; // I definitely fucked up here I shouldn't have the same addresses for POSITION and INTEREST
constexpr uint64_t CAMERA_INTR_SETTER_ADDRESS = 0x00000001400d5370;
constexpr uint64_t CAMERA_ROT_SETTER_ADDRESS = 0x00000001400d53f0;
constexpr uint64_t CAMERA_PERS_SETTER_ADDRESS = 0x00000001400d53b0;

constexpr uint64_t UPDATE_TASKS_ADDRESS = 0x0000000140070110;
constexpr uint64_t GLUT_SET_CURSOR_ADDRESS = 0x0000000140810256;
constexpr uint64_t CHANGE_MODE_ADDRESS = 0x0000000140069710;
constexpr uint64_t CHANGE_SUB_MODE_ADDRESS = 0x00000001400695a0; // finished here 14:34CST 04/16/2020

constexpr uint64_t TGT_CLASS_ADDRESS = 0x0000000140ff9e00;
constexpr uint64_t TGT_STATES_FIRST_POINTER_ADDRESS = 0x0000000140FF9E20;
constexpr uint64_t TGT_STATES_BASE_ADDRESS = 0x0000000140FF9E28;
constexpr uint64_t TGT_ON_SCREEN_ADDRESS = 0x0000000140FF9E18;

constexpr uint64_t HOLD_STATE_ADDRESS = 0x000000014100c9ac; // this is referenced by FUN_14012a230 in 7.10, by LAB_14012a2a0. time to ref! update: that shit hurted
constexpr uint64_t MAX_HOLD_STATE_ADDRESS = 0x000000014100C9D4;

constexpr uint64_t CHECK_SOMETHING_SET_MODULE_ADDRESS = 0x0000000140581C78; // this is contained in some huge ass function FUN_1405816e0 in 7.10...im not sure i even need these constants
constexpr uint64_t MODSELECTOR_CHECK_FUNCTION_ERRRET_ADDRESS = 0x00000001405869AD; // because of tools
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_MODULE = 0x0000000140583B45;
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_CUSTOMIZE = 0x0000000140583C8C;
constexpr uint64_t MODULE_TABLE_START = PLAYER_DATA_ADDRESS + 0x140;
constexpr uint64_t MODULE_TABLE_END = MODULE_TABLE_START + 128;
constexpr uint64_t ITEM_TABLE_START = PLAYER_DATA_ADDRESS + 0x2B8;
constexpr uint64_t ITEM_TABLE_END = ITEM_TABLE_START + 128;

constexpr uint64_t FB_WIDTH_ADDRESS = 0x0000000140F0F628;
constexpr uint64_t FB_HEIGHT_ADDRESS = 0x0000000140F0F62C;
constexpr uint64_t FB1_WIDTH_ADDRESS = 0x0000000140f11438;
constexpr uint64_t FB1_HEIGHT_ADDRESS = 0x0000000140f1143c;
constexpr uint64_t FB2_WIDTH_ADDRESS = 0x0000000140d8d354;
constexpr uint64_t FB2_HEIGHT_ADDRESS = 0x0000000140d8d358;

constexpr uint64_t FB_RESOLUTION_WIDTH_ADDRESS = 0x0000000140F0F4D0;
constexpr uint64_t FB_RESOLUTION_HEIGHT_ADDRESS = 0x0000000140F0F4D4;

constexpr uint64_t UI_WIDTH_ADDRESS = 0x0000000140f8f604;
constexpr uint64_t UI_HEIGHT_ADDRESS = 0x0000000140f8f608;

constexpr uint64_t FB_ASPECT_RATIO = 0x0000000140e3a568;
constexpr uint64_t UI_ASPECT_RATIO = 0x0000000140f8f600;

// I do not think it is going very well at this point but that's ok i think

constexpr uint64_t GET_SLIDER_TAPPED_ADDRESS = 0x000000014048a3a0;
constexpr uint64_t GET_SLIDER_RELEASED_ADDRESS = 0x000000014048a380;
constexpr uint64_t GET_SLIDER_DOWN_ADDRESS = 0x000000014048a360;

constexpr uint64_t SHOULD_EXIT_BOOL_ADDRESS = 0x0000000140d8d140;
constexpr uint64_t DOEXIT_ADDRESS = 0x00000001407a388c; // proper exiting in 4.00 now

constexpr uint64_t RESULTS_INIT_ADDRESS = 0x000000014065BBC0; //I didn't do this either.
constexpr uint64_t RESULTS_BASE_ADDRESS = 0x000000014CC93830;
constexpr uint64_t GAME_INFO_ADDRESS = 0x0000000141197E00;

constexpr uint64_t CURRENT_SONG_NAME_ADDRESS = 0x0000000140D0A578;
constexpr uint64_t CURRENT_SONG_ID_ADDRESS = 0x0000000140CDD8E0;
constexpr uint64_t SELPV_CURRENT_SONG_ADDRESS = 0x000000014CC12438;
constexpr uint64_t SONG_CLEAR_COUNTS_ADDRESS = 0x00000001411A95E8;

constexpr uint64_t AUDIO_MAIN_CLASS_ADDRESS = 0x000000014CC61120;

constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_ADDRESS = 0x0000000140D0B518;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_START_FROM_TIME_ADDRESS = 0x0000000140D0B540;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_START_SYS_TIME_ADDRESS = 0x0000000140D0B548;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_ADDRESS_2 = 0x0000000140D0B520;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_START_FROM_TIME_ADDRESS_2 = 0x0000000140D0B560;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_START_SYS_TIME_ADDRESS_2 = 0x0000000140D0B568;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_PAUSE_FUNC_ADDRESS = 0x00000001401295C0;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_UNPAUSE_FUNC_ADDRESS = 0x0000000140129590;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_POSITION_ADDRESS = 0x0000000140D098A4;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_RESET_ADDRESS = 0x0000000140D0B538;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_RESET_ADDRESS_2 = 0x0000000140D0B512;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_RESET_FLAG_1 = 0x0000000140CDD7D0;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ DSC_TIME_RESET_FLAG_2 = 0x0000000140CDD7D4;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ PV_GAME_BASE_ADDRESS = 0x000000014CC95270;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ GIVEUP_FUNC_ADDRESS = 0x000000014010EF00;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ PV_STATE_ADDRESS = 0x0000000140D0B512;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ PV_LOADING_STATE_ADDRESS = 0x0000000140D0B524;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ PV_INNER_LOADING_STATE_ADDRESS = 0x0000000140CDD8D8;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ AET_DEBUG_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0x98;
constexpr uint64_t /* This will be done at a later date. This is unimportant for now. */ AET_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0xD8;
#endif

#if GAME_VERSION == 200
constexpr uint64_t PREVENT_DATA_TEST_EXIT = 0x0000000140479210;
constexpr uint64_t ENABLE_DW_GUI = 0x0000000140063421;
constexpr uint64_t UPDATE_DW_GUI = 0x00000001401bbc40;
constexpr uint64_t DRAW_DW_GUI = 0x00000001401bbc50;
constexpr uint64_t ENABLE_DW_GUI_WIDGETS = 0x0000000140063b10;
// debugging suites done.
constexpr uint64_t ENGINE_UPDATE_ADDRESS = 0x000000014005d910;
constexpr uint64_t ENGINE_UPDATE_INPUT_ADDRESS = 0x000000014005d880;
constexpr uint64_t ENGINE_DRAW_2D_ADDRESS = 0x00000001403861f0;
constexpr uint64_t ENGINE_FINISH_DRAW_ADDRESS = 0x0000000140063550;
// basic engine hooks done.
constexpr uint64_t CURRENT_GAME_STATE_ADDRESS = 0x0000000140d12510;
constexpr uint64_t CURRENT_GAME_SUB_STATE_ADDRESS = (0x0000000140d12510 + 0x1C); // add 0x1C to the main data block 
constexpr uint64_t RESOLUTION_WIDTH_ADDRESS = 0x0000000140d125bc;
constexpr uint64_t RESOLUTION_HEIGHT_ADDRESS = 0x0000000140d125c0;
// resolution and game state addresses done.
constexpr uint64_t SYSTEM_WARNING_ELAPSED_ADDRESS = (0x0000000140e8a630 + 0x68);
constexpr uint64_t DATA_INIT_STATE_ADDRESS = 0x0000000140d124c8;
// system and data init addresses done.
constexpr uint64_t AET_FRAME_DURATION_ADDRESS = 0x000000014085aee0;
constexpr uint64_t PV_FRAME_RATE_ADDRESS = 0x0000000140d124ec;
constexpr uint64_t FRAME_SPEED_ADDRESS = 0x0000000140d124b8;
constexpr uint64_t FRAME_RATE_ADDRESS = 0x0000000140d123f0;
constexpr uint64_t USE_AUTO_FRAMESPEED_ADDRESS = 0x0000000140d124bc;
constexpr uint64_t AUTO_FRAMESPEED_TARGET_FRAMERATE_ADDRESS = 0x0000000140d123ec;
// framespeed addresses done.
constexpr uint64_t DW_GUI_DISPLAY_INSTANCE_PTR_ADDRESS = 0x0000000140e768e8;
constexpr uint64_t INPUT_STATE_PTR_ADDRESS = 0x0000000140d12050;
constexpr uint64_t SLIDER_CTRL_TASK_ADDRESS = 0x0000000140ed6760;
constexpr uint64_t TASK_TOUCH_ADDRESS = 0x0000000140f16c00;
constexpr uint64_t SEL_PV_DATA_BLOCK = 0x0000000140ec8ad0;
constexpr uint64_t SEL_PV_TIME_ADDRESS = (SEL_PV_DATA_BLOCK + 0xB38); // add 0xB38 to the main data block.
constexpr uint64_t PV_SEL_SLOTS_TO_SCROLL = (SEL_PV_DATA_BLOCK + 0xB10); // add 0xB10 to the main data block.
constexpr uint64_t PV_SEL_SLOTS_CONST = (SEL_PV_DATA_BLOCK + 0x68); // add 0x68 to the main data block.
constexpr uint64_t PLAYER_DATA_ADDRESS = 0x0000000140e91280;
constexpr uint64_t SET_DEFAULT_PLAYER_DATA_ADDRESS = 0x0000000140345460;
constexpr uint64_t PLAYS_PER_SESSION_GETTER_ADDRESS = 0x000000014024aac0;
constexpr uint64_t MODULE_SEL_DATA_BLOCK = 0x0000000140ec68c0;
constexpr uint64_t MODULE_SEL_SLOTS_TO_SCROLL = (MODULE_SEL_DATA_BLOCK + 0x130C); // add 0x130C to the main data block.
constexpr uint64_t MODULE_IS_RECOMMENDED = (MODULE_SEL_DATA_BLOCK + 0x1300); // add 0x1300 to the main data block.
// slider / mouse stuff done.
constexpr uint64_t CAMERA_ADDRESS = 0x0000000140dbf7b0;
constexpr uint64_t CAMERA_POS_SETTER_ADDRESS = 0x00000001400d1560;
constexpr uint64_t CAMERA_INTR_SETTER_ADDRESS = 0x00000001400d1500;
constexpr uint64_t CAMERA_ROT_SETTER_ADDRESS = 0x00000001400d1580;
constexpr uint64_t CAMERA_PERS_SETTER_ADDRESS = 0x00000001400d1540;
// camera addresses done.
constexpr uint64_t UPDATE_TASKS_ADDRESS = 0x000000014006cb70;
constexpr uint64_t GLUT_SET_CURSOR_ADDRESS = 0x00000001407B998E;
constexpr uint64_t CHANGE_MODE_ADDRESS = 0x0000000140066130;
constexpr uint64_t CHANGE_SUB_MODE_ADDRESS = 0x0000000140065fc0;
// task setting addresses done.
constexpr uint64_t TGT_CLASS_ADDRESS = 0x0000000140f463a0;
constexpr uint64_t TGT_STATES_FIRST_POINTER_ADDRESS = (TGT_CLASS_ADDRESS + 0x20); // add 0x20 to the TGT_CLASS_ADDRESS.
constexpr uint64_t TGT_STATES_BASE_ADDRESS = (TGT_CLASS_ADDRESS + 0x28); // add 0x28 to the TGT_CLASS_ADDRESS.
constexpr uint64_t TGT_ON_SCREEN_ADDRESS = (TGT_CLASS_ADDRESS + 0x18); // add 0x18 to the TGT_CLASS_ADDRESS.
// target state addresses done.
constexpr uint64_t HOLD_STATE_DATA_ADDRESS = 0x0000000140f58b3c;
constexpr uint64_t HOLD_STATE_ADDRESS = (HOLD_STATE_DATA_ADDRESS + 0x10); // add 0x10 to the main data block.
constexpr uint64_t MAX_HOLD_STATE_ADDRESS = (HOLD_STATE_DATA_ADDRESS + 0x38); // add 0x38 to the main data block.
// hold state definitions done.
constexpr uint64_t CHECK_SOMETHING_SET_MODULE_ADDRESS = 0x00000001403fa742;
constexpr uint64_t MODSELECTOR_CHECK_FUNCTION_ERRRET_ADDRESS = 0x00000001403ff0dd;
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_MODULE = 0x00000001403fc49a;
constexpr uint64_t MODSELECTOR_CLOSE_AFTER_CUSTOMIZE = 0x00000001403fc5e1;
constexpr uint64_t MODULE_TABLE_START = PLAYER_DATA_ADDRESS + 0x140;
constexpr uint64_t MODULE_TABLE_END = MODULE_TABLE_START + 128;
constexpr uint64_t ITEM_TABLE_START = PLAYER_DATA_ADDRESS + 0x2B8;
constexpr uint64_t ITEM_TABLE_END = ITEM_TABLE_START + 128;
// module and item table stuff done.
constexpr uint64_t FB_DATA_BLOCK = 0x0000000140e93578; // this is called in the function FUN_1404ae8a0 in 7.10. this one is impossibly difficult to find, I think.
constexpr uint64_t FB_WIDTH_ADDRESS = (FB_DATA_BLOCK + 0x1B0); // add 0x1B0 from the FB_DATA_BLOCK.
constexpr uint64_t FB_HEIGHT_ADDRESS = (FB_DATA_BLOCK + 0x1B4); // add 0x1B4 from the FB_DATA_BLOCK.
constexpr uint64_t FB1_WIDTH_ADDRESS = 0x0000000140e9acb8;
constexpr uint64_t FB1_HEIGHT_ADDRESS = 0x0000000140e9acbc; // these two are a little less painful to find that the FB_DATA_BLOCK ones.
constexpr uint64_t FB2_WIDTH_ADDRESS = 0x0000000140d125e4;
constexpr uint64_t FB2_HEIGHT_ADDRESS = 0x0000000140d125e8; // same for these two.

constexpr uint64_t FB_RESOLUTION_WIDTH_ADDRESS = (FB_DATA_BLOCK + 0x58); // add 0x58 from the FB_DATA_BLOCK.
constexpr uint64_t FB_RESOLUTION_HEIGHT_ADDRESS = (FB_DATA_BLOCK + 0x5C); // add 0x5C from the FB_DATA_BLOCK.

constexpr uint64_t UI_WIDTH_ADDRESS = 0x0000000140eda704;
constexpr uint64_t UI_HEIGHT_ADDRESS = 0x0000000140eda708; // not quite the same in 2.00 but I'll take it.

constexpr uint64_t FB_ASPECT_RATIO = 0x0000000140dbf7d8; // not painful.
constexpr uint64_t UI_ASPECT_RATIO = 0x0000000140eda6f0; // this one is painful. you have been warned.

constexpr uint64_t GET_SLIDER_TAPPED_ADDRESS = 0x000000014045e5a0;
constexpr uint64_t GET_SLIDER_RELEASED_ADDRESS = 0x000000014045e580;
constexpr uint64_t GET_SLIDER_DOWN_ADDRESS = 0x000000014045e560;
// slider addresses done.
constexpr uint64_t SHOULD_EXIT_BOOL_ADDRESS = 0x0000000140d123d0;
constexpr uint64_t DOEXIT_ADDRESS = 0x000000014074d48c; // this one should be easy. just go to the doexit label (in ghidra).

constexpr uint64_t RESULTS_INIT_ADDRESS = 0x000000014049fba0; // I'll stop here and compile for now to see if I get any crashes. 
constexpr uint64_t RESULTS_BASE_ADDRESS = 0x0000000140f0bcc0;
constexpr uint64_t GAME_INFO_ADDRESS = 0x0000000140e81a40;
// these are done.
constexpr uint64_t CURRENT_SONG_NAME_ADDRESS = 0x0000000140D0A578;
constexpr uint64_t CURRENT_SONG_ID_ADDRESS = 0x0000000140CDD8E0;
constexpr uint64_t SELPV_CURRENT_SONG_ADDRESS = 0x000000014CC12438;
constexpr uint64_t SONG_CLEAR_COUNTS_ADDRESS = 0x00000001411A95E8;
// these aren't done.
constexpr uint64_t AUDIO_MAIN_CLASS_ADDRESS = 0x0000000140ed9a40;
// done
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_ADDRESS = 0x0000000140D0B518;
constexpr uint64_t /* this can be done at a later date. */ DSC_START_FROM_TIME_ADDRESS = 0x0000000140D0B540;
constexpr uint64_t /* this can be done at a later date. */ DSC_START_SYS_TIME_ADDRESS = 0x0000000140D0B548;
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_ADDRESS_2 = 0x0000000140D0B520;
constexpr uint64_t /* this can be done at a later date. */ DSC_START_FROM_TIME_ADDRESS_2 = 0x0000000140D0B560;
constexpr uint64_t /* this can be done at a later date. */ DSC_START_SYS_TIME_ADDRESS_2 = 0x0000000140D0B568;
constexpr uint64_t /* this can be done at a later date. */ DSC_PAUSE_FUNC_ADDRESS = 0x00000001401295C0;
constexpr uint64_t /* this can be done at a later date. */ DSC_UNPAUSE_FUNC_ADDRESS = 0x0000000140129590;
constexpr uint64_t /* this can be done at a later date. */ DSC_POSITION_ADDRESS = 0x0000000140D098A4;
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_RESET_ADDRESS = 0x0000000140D0B538;
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_RESET_ADDRESS_2 = 0x0000000140D0B512;
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_RESET_FLAG_1 = 0x0000000140CDD7D0;
constexpr uint64_t /* this can be done at a later date. */ DSC_TIME_RESET_FLAG_2 = 0x0000000140CDD7D4;
constexpr uint64_t /* this can be done at a later date. */ PV_GAME_BASE_ADDRESS = 0x000000014CC95270;
constexpr uint64_t /* this can be done at a later date. */ GIVEUP_FUNC_ADDRESS = 0x000000014010EF00;
constexpr uint64_t /* this can be done at a later date. */ PV_STATE_ADDRESS = 0x0000000140D0B512;
constexpr uint64_t /* this can be done at a later date. */ PV_LOADING_STATE_ADDRESS = 0x0000000140D0B524;
constexpr uint64_t /* this can be done at a later date. */ PV_INNER_LOADING_STATE_ADDRESS = 0x0000000140CDD8D8;
constexpr uint64_t /* this can be done at a later date. */ AET_DEBUG_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0x98;
constexpr uint64_t /* this can be done at a later date. */ AET_ARRAY_POINTER_ADDRESS = 0x0000000140EC5430 + 0xD8;
#endif

#define XINPUT_A 0x00
#define XINPUT_B 0x01
#define XINPUT_X 0x02
#define XINPUT_Y 0x03
#define XINPUT_UP 0x10
#define XINPUT_DOWN 0x11
#define XINPUT_LEFT 0x12
#define XINPUT_RIGHT 0x13
#define XINPUT_LS 0x20
#define XINPUT_RS 0x21
#define XINPUT_LT 0x22
#define XINPUT_RT 0x23
#define XINPUT_LSB 0x24
#define XINPUT_RSB 0x25
#define XINPUT_START 0x30
#define XINPUT_BACK 0x31
#define XINPUT_LUP 0x40
#define XINPUT_LDOWN 0x41
#define XINPUT_LLEFT 0x42
#define XINPUT_LRIGHT 0x43
#define XINPUT_RUP 0x50
#define XINPUT_RDOWN 0x51
#define XINPUT_RLEFT 0x52
#define XINPUT_RRIGHT 0x53  